using System;
using System.Data;

namespace DataScripter.Scripting.Processes.Morphs
{
    public class NewIdMorphAction : BaseFieldMorphAction
    {
        #region Overrides of BaseFieldMorphAction

        public override void Apply(DataTable @from, DataTable to)
        {
            to.Columns.Add(FieldName, typeof (Guid));
        }

        public override void Apply(DataRow @from, DataRow to, DataTable fromTable, DataTable targetTable)
        {
            to[FieldName] = Guid.NewGuid();
        }

        #endregion
    }
}